<template>
  <div class="block">
    <el-carousel trigger="click" class="block">
      <el-carousel-item v-for="item in images" :key="item">
        <el-image
        style="width: 100%; height: 100%"
        :src="item.image"
        :fit="fit"
        @click="$router.push('/FilmDetail?id='+item.id)"
        class="point"></el-image>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>

export default {
  data() {
    return {
      images:[
        {
          image:require("../assets/img/red.jpg"),
          id:257,
        },
        {
          image:require("../assets/img/sea.jpeg"),
          id:359,
        },
        {
          image:require("../assets/img/earth.jpeg"),
          id:255,
        },
        {
          image:require("../assets/img/water.jpeg"),
          id:283,
        },
      ]
    }
  },

  methods: {
   
  },
}
</script>


<style>
  .block{
    width:100%;
    height:100%;
  }
  .point{
    cursor: pointer;
  }

  .block .carousel{
    width:100%;
    height:100%;
  }
  .el-carousel__container{
    height:100%;
    width:100%;
  }
  .el-carousel__item:nth-child(2n) {
     background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
     background-color: #d3dce6;
  }
</style>